import request from "@/utils/request";
// 小程序添加宠物
export function addPet(data) {
  return request({
    url: "/pet/app/insert",
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
// 小程序获取宠物列表
export function getPetList(params) {
  return request({
    url: "/pet/app/myList",
    headers: {
        isToken: true,
    },
    method: "get",
    params
  });
}
// 小程序获取宠物详情
export function getPetDetail(id) {
  return request({
    url: `/pet/app/detail/${id}`,
    headers: {
        isToken: true,
    },
    method: "get",

  });
}
//小程序删除宠物
export function delPet(id) {
  return request({
    url: `/pet/app/delete/${id}`,
    headers: {
        isToken: true,
    },
    method: "delete",
   
  });
}
//小程序修改宠物信息
export function updatePet(data) {
  return request({
    url: `/pet/app/update`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//传地址和范围
export function getPetListByLocation(data) {
  return request({
    url: `/pet/fence/app/insert`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//获取围栏列表
export function getFenceList() {
  return request({
    url: `/pet/fence/app/list`,
    headers: {
        isToken: true,
    },
    method: "get",
  });
}
//删除围栏
export function delFence(data) {
  return request({
    url: `/pet/fence/app/delete`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//围栏关闭。开启
export function closeFence(data) {
  return request({
    url: `/pet/fence/app/status`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//小程序查询设备列表
export function getDeviceList(params) {
  return request({
    url: `/pet/device/app/list`,
    headers: {
        isToken: true,
    },
    method: "get",
    params
  });
}
//小程序删除设备传设备id
export function delDevice(data) {
  return request({
    url: `/pet/device/app/delete`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//关闭设备status 0关闭1开启
export function closeDevice(data) {
  return request({
    url: `/pet/device/app/statue`,
    headers: {
        isToken: true,
    },
    method: "post",
    data
  });
}
//小程序获取消息
export function getMessageList(params) {
  return request({
    url: `/pet/sys_msg/app/list`,
    headers: {
        isToken: true,
    },
    method: "get",
    params
  });
}

//小程序获取轨迹
export function getTrackList(params) {
  return request({
    url: `/pet/coordinate/app/list`,
    headers: {
        isToken: true,
    },
    method: "get",
    params
  });
}